<?php

namespace app\admin\validate;

use think\Validate;

class Order extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'id' => 'require',
        'goods_id' => 'require',
        'goods_num' => 'require',
        'delivery_method' => 'require',
        'deduct_money' => 'require',
        'express' => 'require',
        'express_no' => 'require',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'id.require' => '请填写ID',
        'goods_id.require' => '请填写商品id',
        'goods_num.require' => '请填写商品数量',
        'delivery_method.require' => '请选择提货方式',
        'deduct_money.require' => '请填写抵扣金额',
        'express.require' => '请填写快递公司',
        'express_no.require' => '请填写快递单号',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add' => ['goods_id', 'goods_num', 'delivery_method','deduct_money'],
        'edit' => ['id'],
        'info' => ['id'],
        'pay' => ['id'],
        'cancel' => ['id'],
        'receiving' => ['id'],
        'confirmDelivery' => ['id','express','express_no'],
    ];

}
